/**
,editoptions:{size:12,dataInit: function(element) {$(element).datepicker({dateFormat: 'yy-mm-dd'})}} 
,formoptions:{elmprefix:'(*)'}
, edittype:'select', editoptions:{value:{1:'One',2:'Two'}}
,editrules:{number:true}
**/

//一、高额配件入库记录
$(document).ready(function(){	
	$("#list_rk").jqGrid({
		url: '/ajax/ajax_zy_high_value_arrive.php?'+url_obj, //显示的数据
		//editurl: '/ajax/ajax_zy_high_value_arrive.php?'+url_obj,
		datatype: 'json', //xml、json、local(js直接赋值)
		mtype: 'POST',
		colNames: ["序号(Item)", "物资编码(Material Code)","物资名称(Name)","规格型号(Specification)","供应商(Supplier)","入库数量(Storage Quantity)","入库日期(Arrive Time)","经办人(Operator)"], //表头标题别名
		colModel: [
			{name: 'hva_id', index: 'hva_id', width: 70,fixed:true,searchoptions:{sopt: ['eq']}},			
			{name: 'material_code', index: 'material_code', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'material_name', index: 'material_name', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'specification', index: 'specification', width: 180, align: 'left', sortable:false, editable:false},
			{name: 'supplier', index: 'supplier', width: 180, sortable:false, editable:false},
			{name: 'storage_quantity', index: 'storage_quantity', width: 180, sortable:false, editable:false},
			{name: 'arrive_time', index: 'arrive_time', width: 140, sortable:false, editable:false},
			{name: 'operator', index: 'operator', width: 140, sortable:false, editable:false}
		],
		// JSON
		jsonReader: { 
			root: "list_data", 
			page: "page", 
			total: "total", 
			records: "records",
			repeatitems: false
		},
		//width: 600,
		height:130,//整个显示的最大高度
		autowidth:true,
		shrinkToFit:false, //水平滚动条
		pager: $('#pager_rk'),
		//pgbuttons: true,
		rowNum: 5, //每页显示记录数
		rowList:[5,10,20], //可调整每页显示的记录数
		sortname: 'hva_id',
		rownumbers: true, //自动行号
		//sortorder: "desc",
		viewrecords: true //是否显示行数
	});
	
	$("#list_rk").navGrid("#pager_rk", {
			refresh: true,
			edit: false,
			add: false,
			del:false,
			search: false,
			position: "left"
		}
	);
});

//二、高额配件库存记录
$(document).ready(function(){	
	$("#list_inventory").jqGrid({
		url: '/ajax/ajax_zy_high_value_storage.php?'+url_obj, //显示的数据
		//editurl: '/ajax/ajax_zy_high_value_storage.php?'+url_obj,
		datatype: 'json', //xml、json、local(js直接赋值)
		mtype: 'POST',
		colNames: ["序号(Item)", "物资编码(Material Code)","物资名称(Name)","规格型号(Specification)","供应商(Supplier)","库存数量(Storage Quantity)","累计消耗数量(Consumed Quantity)","存储位置(Storage Place)"], //表头标题别名
		colModel: [
			{name: 'hvs_id', index: 'hvs_id', width: 70,fixed:true,searchoptions:{sopt: ['eq']}},			
			{name: 'material_code', index: 'material_code', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'material_name', index: 'material_name', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'specification', index: 'specification', width: 180, align: 'left', sortable:false, editable:false},
			{name: 'supplier', index: 'supplier', width: 180, sortable:false, editable:false},
			{name: 'storage_quantity', index: 'storage_quantity', width: 180, sortable:false, editable:false},
			{name: 'consumed_quantity', index: 'consumed_quantity', width: 180, sortable:false, editable:false},
			{name: 'storage_place', index: 'storage_place', width: 180, sortable:false, editable:false}
		],
		// JSON
		jsonReader: { 
			root: "list_data", 
			page: "page", 
			total: "total", 
			records: "records",
			repeatitems: false
		},
		//width: 600,
		height:130,//整个显示的最大高度
		autowidth:true,
		shrinkToFit:false, //水平滚动条
		pager: $('#pager_inventory'),
		//pgbuttons: true,
		rowNum: 5, //每页显示记录数
		rowList:[5,10,20], //可调整每页显示的记录数
		sortname: 'hvs_id',
		rownumbers: true, //自动行号
		//sortorder: "desc",
		viewrecords: true //是否显示行数
	});
	
	$("#list_inventory").navGrid("#pager_inventory", {
			refresh: true,
			edit: false,
			add: false,
			del:false,
			search: false,
			position: "left"
		}
	);
});

//三、高额配件消耗记录
$(document).ready(function(){	
	$("#list_consume").jqGrid({
		url: '/ajax/ajax_zy_high_value_use.php?'+url_obj, //显示的数据
		//editurl: '/ajax/ajax_zy_high_value_use.php?'+url_obj,
		datatype: 'json', //xml、json、local(js直接赋值)
		mtype: 'POST',
		colNames: ["序号(Item)", "物资编码(Material Code)","物资名称(Name)","规格型号(Specification)","出库日期(Consumer time)","经办人(Operator)","井名(Well Name)","作业层位(Test No)"], //表头标题别名
		colModel: [
			{name: 'hvu_id', index: 'hvu_id', width: 70,fixed:true,searchoptions:{sopt: ['eq']}},			
			{name: 'material_code', index: 'material_code', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'material_name', index: 'material_name', width: 180,fixed:true, align: 'left', sortable:false, editable:false},
			{name: 'specification', index: 'specification', width: 180, align: 'left', sortable:false, editable:false},
			{name: 'consumer_time', index: 'consumer_time', width: 140, sortable:false, editable:false},
			{name: 'operator', index: 'operator', width: 140, sortable:false, editable:false},
			{name: 'well_name', index: 'well_name', width: 180, align: 'left', sortable:false, editable:false},
			{name: 'test_no', index: 'test_no', width: 180, sortable:false, editable:false}
		],
		// JSON
		jsonReader: { 
			root: "list_data", 
			page: "page", 
			total: "total", 
			records: "records",
			repeatitems: false
		},
		//width: 600,
		height:130,//整个显示的最大高度
		autowidth:true,
		shrinkToFit:false, //水平滚动条
		pager: $('#pager_consume'),
		//pgbuttons: true,
		rowNum: 5, //每页显示记录数
		rowList:[5,10,20], //可调整每页显示的记录数
		sortname: 'hvu_id',
		rownumbers: true, //自动行号
		//sortorder: "desc",
		viewrecords: true //是否显示行数
	});
	
	$("#list_consume").navGrid("#pager_consume", {
			refresh: true,
			edit: false,
			add: false,
			del:false,
			search: false,
			position: "left"
		}
	);
});